<?php
	@session_start(); 
	include_once("../app/connection.php");
    include_once("../app_sv/check_user.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/index.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="../css/default.css"/>
<link rel="stylesheet" type="text/css" href="../css/ddsmoothmenu.css"/>

<script src="../js/jquery-1.10.0.js"></script>
<script src="../js/home_menu.js"></script>
<script src="../js/check_info.js"></script>

<script type="text/javascript">
    ddsmoothmenu.init({
    	mainmenuid: "smoothmenu1", //menu DIV id
    	orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
    	classname: 'ddsmoothmenu', //class added to menu's outer DIV
    	//customtheme: ["#1c5a80", "#18374a"],
    	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
    })
	
	$(function() {
		$('.banner img:gt(0)').hide();
			setInterval(function(){
			  $('.banner :first-child').fadeOut().next('img').fadeIn().end().appendTo('.banner');}
			  ,4000);
	}); // slide banner

</script>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Website QLSV va DKMH</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
</head>

<body>
    <div id="logo">
        <img src="../image/source/logo.png" />
    </div>
    
    <div class="banner">
    	<img src="../image/source/uit1.jpg" width="1000" height="250" />
        <img src="../image/source/uit2.jpg" width="1000" height="250" />
        <img src="../image/source/uit3.jpg" width="1000" height="250" />
        <img src="../image/source/uit4.jpg" width="1000" height="250" />
        <img src="../image/source/uit5.jpg" width="1000" height="250" />
    </div><br/>
    
    <div id="smoothmenu1" class="ddsmoothmenu">
        <ul>
            <li><a href="../">TRANG CHỦ</a></li>
            <li><a href="../">GIẢNG VIÊN</a>
                <ul>
                    <li><a href="../">THỜI KHÓA BIỂU</a></li>
                    <li><a href="../?page=tbnh">NGHỈ - HỌC BÙ</a></li>
                    <li><a href="../?page=ttgv">THÔNG TIN LÝ LỊCH</a></li>
                    <li><a href="../">QUẢN LÝ ĐIỂM</a></li>
                    <li><a href="Excel_process/teacher_uploadForm.php">NHẬP ĐIỂM</a></li>
                </ul>
            </li>
            
            <li><a href="../">SINH VIÊN</a>
                <ul>
                    <li><a href="../app_sv/tkb_sv.php">THỜI KHÓA BIỂU</a></li>
                    <li><a href="../app_sv/check_dk.php">ĐK MÔN HỌC</a></li>
                    <li><a href="../?page=ttll">THÔNG TIN LÝ LỊCH</a></li>
                    <li><a href="../">KẾT QUẢ HỌC TẬP</a></li>
                    <li><a href="Excel_process/studentExport.php">XUẤT DỮ LIỆU ĐA CHỨC NĂNG</a></li>   
                </ul>
            </li> 
            <li><a href="../?page=tltk">THIẾT LẬP TÀI KHOẢN</a></li>
        </ul>
        <br style="clear: left" />
    </div>
    <!-- InstanceBeginEditable name="content" -->
    <div id="container">
       <?php
	  if(isset($_SESSION['s_user']) && isset($_SESSION['s_pass']))
	  {
		  //s$u = $_SESSION['s_user'];
			if(!$is_sv)
			{
				$sql = mysql_query("SELECT * FROM giaovien WHERE MAGIAOVIEN = '$user'");
				$row = mysql_fetch_assoc($sql);
?>
        <center>
            <span style="font-size: 18pt;"><i>
                <b>MAGV: </b><?php echo $row['MAGIAOVIEN']; ?> - <b>Họ và tên: </b><?php echo $row['HOTEN']; ?>
                - <b>KHOA: </b><?php echo $row['MAKHOA']; ?>
            </i></span> <br /><br />
        </center>              
    	<center><table border="1" style="border-collapse:collapse;" id="tkb">
        	<tr><th></th><th>Thứ 2</th><th>Thứ 3</th><th>Thứ 4</th><th>Thứ 5</th><th>Thứ 6</th><th>Thứ 7</th></tr>
            <tr><th style="width: 30px;">Ca 1</th><td id="c1_t2"></td><td id="c1_t3"></td><td id="c1_t4"></td><td id="c1_t5"></td><td id="c1_t6"></td><td id="c1_t7"></td></tr>
            <tr><th>Ca 2</th><td id="c2_t2"></td><td id="c2_t3"></td><td id="c2_t4"></td><td id="c2_t5"></td><td id="c2_t6"></td><td id="c2_t7"></td></tr>
            
            <tr><td colspan="7" style="background: #247CB9; height: 10px; padding: 0;">&nbsp;</td></tr>
            
            <tr><th>Ca 3</th><td id="c3_t2"></td><td id="c3_t3"></td><td id="c3_t4"></td><td id="c3_t5"></td><td id="c3_t6"></td><td id="c3_t7"></td></tr>
            <tr><th>Ca 4</th><td id="c4_t2"></td><td id="c4_t3"></td><td id="c4_t4"></td><td id="c4_t5"></td><td id="c4_t6"></td><td id="c4_t7"></td></tr>
        </table></center>
        <span>
        <br /> <b>Thời gian:</b> <br />
        	Ca 1 : 7h30 - 9h45 <br/>
            Ca 2 : 10h - 11h30 <br />
            Ca 3 : 13h - 14h30 <br />
            Ca 4 : 14h45 - 16h45 
            
        </span>
        
<?php
        
				$today = date('Y-m-d');
			  
				$cm = "SELECT * FROM lop, monhoc, hocky, giaovien WHERE monhoc.MAMONHOC = lop.MAMONHOC 
                    AND giaovien.MAGIAOVIEN = lop.MAGIAOVIEN AND 	hocky.HOCKY = lop.HOCKY AND hocky.NAM = lop.NAM 
                    AND giaovien.MAGIAOVIEN='$user' AND NGAYBATDAU <= '$today' AND NGAYKETTHUC >= '$today'";
				$r = mysql_query($cm,$connect) or die(mysql_error($connect));
				//$rs = mysql_fetch_array($r);
				while($rs = mysql_fetch_array($r))
				{
					//echo $rs['mssv']." ".$rs['mamh']." ".$rs['malop_mh']." ".$rs['tenmh']." ".$rs['ca']." ".$rs['thu']."<br />";
					$ca = $rs['CA']; 
					$thu = $rs['THU'];
					$mh = $rs['MAMONHOC'].".".$rs['MALOP'];
					$tmh = $rs['TENMONHOC'];
					$ph = "P.".$rs['PHONG'];
					if($ca == '1')
					{
						if($thu == '2')
						{
						 echo "<script type='text/javascript'>
							
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c1_t2\").innerHTML = x;		
							</script>";
						}
						else if($thu == '3')
						{
							echo "<script type='text/javascript'>
							
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c1_t3\").innerHTML = x;		
							</script>";
						}
						else if($thu == '4')
						{
							echo "<script type='text/javascript'>
							
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c1_t4\").innerHTML = x;		
							</script>";
						}
						else if($thu == '5')
						{
							echo "<script type='text/javascript'>
							
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c1_t5\").innerHTML = x;		
							</script>";
						}
						else if($thu == '6')
						{
							echo "<script type='text/javascript'>
							
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c1_t6\").innerHTML = x;		
							</script>";
						}
						else if($thu == '7')
						{
							echo "<script type='text/javascript'>
							
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c1_t7\").innerHTML = x;		
							</script>";
						}
					} // het ca 1
					else if($ca == '2')
					{
						if($thu == '2')
						{
						 echo "<script type='text/javascript'>
							
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c2_t2\").innerHTML = x;		
							</script>";
						}
						else if($thu == '3')
						{
							echo "<script type='text/javascript'>
							
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c2_t3\").innerHTML = x;		
							</script>";
						}
						else if($thu == '4')
						{
							echo "<script type='text/javascript'>
							
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c2_t4\").innerHTML = x;		
							</script>";
						}
						else if($thu == '5')
						{
							echo "<script type='text/javascript'>
							
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c2_t5\").innerHTML = x;		
							</script>";
						}
						else if($thu == '6')
						{
							echo "<script type='text/javascript'>
							
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c2_t6\").innerHTML = x;		
							</script>";
						}
						else if($thu == '7')
						{
							echo "<script type='text/javascript'>
							
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c2_t7\").innerHTML = x;		
							</script>";
						}
					} // het ca 2
					else if($ca == '3')
					{
						if($thu == '2')
						{
						 echo "<script type='text/javascript'>
							
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c3_t2\").innerHTML = x;		
							</script>";
						}
						else if($thu == '3')
						{
							echo "<script type='text/javascript'>
							
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c3_t3\").innerHTML = x;		
							</script>";
						}
						else if($thu == '4')
						{
							echo "<script type='text/javascript'>
							
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c3_t4\").innerHTML = x;		
							</script>";
						}
						else if($thu == '5')
						{
							echo "<script type='text/javascript'>
							
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c3_t5\").innerHTML = x;		
							</script>";
						}
						else if($thu == '6')
						{
							echo "<script type='text/javascript'>
							
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c3_t6\").innerHTML = x;		
							</script>";
						}
						else if($thu == '7')
						{
							echo "<script type='text/javascript'>
							
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c3_t7\").innerHTML = x;		
							</script>";
						}
					} // het ca 3
					else if($ca == '3')
					{
						if($thu == '2')
						{
						 echo "<script type='text/javascript'>
							
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c4_t2\").innerHTML = x;		
							</script>";
						}
						else if($thu == '3')
						{
							echo "<script type='text/javascript'>
							
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c4_t3\").innerHTML = x;		
							</script>";
						}
						else if($thu == '4')
						{
							echo "<script type='text/javascript'>
							
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c4_t4\").innerHTML = x;		
							</script>";
						}
						else if($thu == '5')
						{
							echo "<script type='text/javascript'>
							
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c4_t5\").innerHTML = x;		
							</script>";
						}
						else if($thu == '6')
						{
							echo "<script type='text/javascript'>
							
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c4_t6\").innerHTML = x;		
							</script>";
						}
						else if($thu == '7')
						{
							echo "<script type='text/javascript'>
							
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c4_t7\").innerHTML = x;		
							</script>";
						}
					} // het ca 4
					else if($ca == '1 - 2')
					{
						if($thu == '2')
						{
						 echo "<script type='text/javascript'>
								document.getElementById(\"c1_t2\").setAttribute(\"rowspan\",2);
								document.getElementById(\"c2_t2\").remove(0);
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c1_t2\").innerHTML = x;
							</script>";
						}
						else if($thu == '3')
						{
							 echo "<script type='text/javascript'>
								document.getElementById(\"c1_t3\").setAttribute(\"rowspan\",2);
								document.getElementById(\"c2_t3\").remove(0);
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c1_t3\").innerHTML = x;
							</script>";
						}
						else if($thu == '4')
						{
							 echo "<script type='text/javascript'>
								document.getElementById(\"c1_t4\").setAttribute(\"rowspan\",2);
								document.getElementById(\"c2_t4\").remove(0);
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c1_t4\").innerHTML = x;
							</script>";
						}
						else if($thu == '5')
						{
							  echo "<script type='text/javascript'>
								document.getElementById(\"c1_t5\").setAttribute(\"rowspan\",2);
								document.getElementById(\"c2_t5\").remove(0);
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c1_t5\").innerHTML = x;
							</script>";
						}
						else if($thu == '6')
						{
							 echo "<script type='text/javascript'>
								document.getElementById(\"c1_t6\").setAttribute(\"rowspan\",2);
								document.getElementById(\"c2_t6\").remove(0);
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c1_t6\").innerHTML = x;
							</script>";
						}
						else if($thu == '7')
						{
							 echo "<script type='text/javascript'>
								document.getElementById(\"c1_t7\").setAttribute(\"rowspan\",2);
								document.getElementById(\"c2_t7\").remove(0);
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c1_t7\").innerHTML = x;
							</script>";
						}
					} // het ca 1 - 2
					else if($ca == '3 - 4')
					{
						if($thu == '2')
						{
						 echo "<script type='text/javascript'>
								document.getElementById(\"c3_t2\").setAttribute(\"rowspan\",2);
								document.getElementById(\"c4_t2\").remove(0);
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c3_t2\").innerHTML = x;
							</script>";
						}
						else if($thu == '3')
						{
							 echo "<script type='text/javascript'>
								document.getElementById(\"c3_t3\").setAttribute(\"rowspan\",2);
								document.getElementById(\"c4_t3\").remove(0);
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c3_t3\").innerHTML = x;
							</script>";
						}
						else if($thu == '4')
						{
							 echo "<script type='text/javascript'>
								document.getElementById(\"c3_t4\").setAttribute(\"rowspan\",2);
								document.getElementById(\"c4_t4\").remove(0);
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c3_t4\").innerHTML = x;
							</script>";
						}
						else if($thu == '5')
						{
							  echo "<script type='text/javascript'>
								document.getElementById(\"c3_t5\").setAttribute(\"rowspan\",2);
								document.getElementById(\"c4_t5\").remove(0);
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c3_t5\").innerHTML = x;
							</script>";
						}
						else if($thu == '6')
						{
							 echo "<script type='text/javascript'>
								document.getElementById(\"c3_t6\").setAttribute(\"rowspan\",2);
								document.getElementById(\"c4_t6\").remove(0);
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c3_t6\").innerHTML = x;
							</script>";
						}
						else if($thu == '7')
						{
							 echo "<script type='text/javascript'>
								document.getElementById(\"c3_t7\").setAttribute(\"rowspan\",2);
								document.getElementById(\"c4_t7\").remove(0);
								var x = \"".$mh.'<br/>'.$tmh."<br/>".$ph."\";
								document.getElementById(\"c3_t7\").innerHTML = x;
							</script>";
						}
					} // het ca 3 - 4			
				}
			}
			else
			{
				echo "Vui lòng đăng nhập bằng tài khoản giáo viên!";
				echo "<meta http-equiv=\"refresh\" content=\"2; URL = ../index.php\">";
			}
	  }
	  else
	  {
		  echo "Vui lòng đăng nhập!";
		  echo "<meta http-equiv=\"refresh\" content=\"2; URL=../index.php\">";
	  }
 ?>     
    </div>
    <!-- InstanceEndEditable --><!--End Container-->

    <div id="footer">
        <div id="contact">
            <?php
                $today = date("d-m-Y");
                echo "Hôm nay: ".$today."<br />";
            ?>
            Liên hệ phòng đào tạo: 
            <ol>
                <li>Địa chỉ: Km20, xa lộ Hà Nội, phường Linh Trung, quận Thủ Đức, Tp Hồ Chí Minh</li>
                <li>Số điện thoại: (08) 37251993 </li>
                <li>Email: uit@uit.edu.vn</li>
                
            </ol>
        </div>
        
        
        <div id="admin">
            <a id="admin-content" href="../admin/ad_login.php" style="font-size:20px; padding-top:10px;">@Bộ phận quản lý</a>
        </div>
    </div>
</body>
<!-- InstanceEnd --></html>